<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<button id="btn">按钮</button>
		<div class="js_div">
			111
		</div>
	</body>
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	<script type="text/javascript">
		$("#btn").click(function(){
			$(".js_div").removeClass("js_div");
		})
		var student = [{
			name:"cheng",
			age:20,
			sex:1,
			score:91
		},{
			name:"zhan",
			age:18,
			sex:1,
			score:96
		},{
			name:"peng",
			age:100,
			sex:1,
			score:90
		}];
		Array.prototype.Sort_s = function(data){
			
			if(this["0"].hasOwnProperty(data)){
				this.sort(function(a,b){
					return a[data] - b[data];
				})
			}else{
				alert("没有此属性");
				return;
			}
			
		}
		student.Sort_s("score");
		console.log(student);
	</script>
</html>
